/**
 * <copyright>
 * </copyright>
 *

 */
package org.openarchitectureware.recipe2.dsl.detector.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import org.openarchitectureware.recipe2.dsl.detector.*;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class DetectorFactoryImpl extends EFactoryImpl implements DetectorFactory
{
  /**
   * Creates the default factory implementation.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public static DetectorFactory init()
  {
    try
    {
      DetectorFactory theDetectorFactory = (DetectorFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.openarchitectureware.org/recipe2/dsl/Detector"); 
      if (theDetectorFactory != null)
      {
        return theDetectorFactory;
      }
    }
    catch (Exception exception)
    {
      EcorePlugin.INSTANCE.log(exception);
    }
    return new DetectorFactoryImpl();
  }

  /**
   * Creates an instance of the factory.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public DetectorFactoryImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public EObject create(EClass eClass)
  {
    switch (eClass.getClassifierID())
    {
      case DetectorPackage.RECIPE_DETECTOR_MODEL: return createRecipeDetectorModel();
      case DetectorPackage.DETECTOR: return createDetector();
      case DetectorPackage.PARAMETER: return createParameter();
      default:
        throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public RecipeDetectorModel createRecipeDetectorModel()
  {
    RecipeDetectorModelImpl recipeDetectorModel = new RecipeDetectorModelImpl();
    return recipeDetectorModel;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Detector createDetector()
  {
    DetectorImpl detector = new DetectorImpl();
    return detector;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Parameter createParameter()
  {
    ParameterImpl parameter = new ParameterImpl();
    return parameter;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public DetectorPackage getDetectorPackage()
  {
    return (DetectorPackage)getEPackage();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @deprecated
   * @generated
   */
  @Deprecated
  public static DetectorPackage getPackage()
  {
    return DetectorPackage.eINSTANCE;
  }

} //DetectorFactoryImpl
